{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth("add")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-open='{:url("add")}'>创建抽奖</button>
<!--{/if}-->

{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">

    <div class="layui-tab-content">
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <th class='list-table-sort-td'>
                <button class="layui-btn layui-btn-xs" data-reload type="button">刷 新</button>
            </th>
            <tr>
                <th class='text-left nowrap'>期号</th>
                <th class='text-left nowrap'>商品信息</th>
                <th class='text-left nowrap'>单价</th>
                <th class='text-left nowrap'>总需人数</th>
                <th class='text-left nowrap'>参与人数</th>
                <th class='text-left nowrap'>期号</th>
                <th class='text-left nowrap'>期数</th>
                <th class='text-left nowrap'>状态</th>
                <th class='text-left nowrap'>热门</th>
                <th class='text-left nowrap'>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>
<!--                <td class='list-table-check-td think-checkbox'>-->
<!--                    <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>-->
<!--                </td>-->

                <td class='list-table-sort-td'>
                    <label><input class="list-sort-input" data-action-blur="{:sysuri()}" data-loading="false" data-value="id#{$vo.id};action#sort;sort#{value}" value="{$vo.id}"></label>
                </td>
                <td class='nowrap'>
                    {notempty name='vo.cover'}
                    <div class="headimg headimg-no" data-tips-hover data-tips-image data-lazy-src="{$vo.cover}"></div>
                    {/notempty}
                    <div class="inline-block sub-span-blue">
                        <div>商品名称：<span>{$vo.goods_name|default='--'}</span></div>
                        <div>商品编号：<span>{$vo.code|default='--'}</span></div>
                    </div>
                </td>
                <td class='nowrap'>{$vo.unit_price}</td>
                <td class='nowrap'>{$vo.people_number}</td>
                <td class='nowrap'>{$vo.participants_number}</td>
                <td class='nowrap'>{if $vo.sequence_total > 1}{$vo.sequence_no}{:sprintf("%03s", $vo.sequence_current)}{else}--{/if}</td>
                <td class='nowrap'>{$vo.sequence_current} / {$vo.sequence_total}</td>
                <td class='nowrap'>{:\\app\\mall_back\\model\\GoodsLuckyDrawModel::getStatusText($vo.status)}</td>
                <td class='nowrap'><?php echo $vo['is_hot'] == 0?'--':'熱門'; ?></td>
                <td class='nowrap sub-strong-blue'>
                    <!--{if auth("edit")}-->
                    <!--{if $vo.is_draw_a_lottery != 1}-->
                    <a class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                    <!--{/if}-->
                    <!--{else}-->
                    <a class="layui-btn layui-btn-xs layui-btn-primary layui-disabled" data-tips-text="您没有编辑商品的权限哦！">编 辑</a>
                    <!--{/if}-->
                    <!--{if $vo.participants_number >= $vo.people_number and $vo.is_draw_a_lottery == 0}-->
                    <a class="layui-btn layui-btn-xs layui-btn-normal" data-action="{:url('run_lottery')}?id={$vo.id}" data-confirm="确认开奖？" data-value="id#{$vo.id};deleted#0">开 奖</a>
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
{/block}